<?php

  include './myinclude/common.inc.php';

  $g_db = new Mysql_Cls($mysqlConfig);

  $page = $_GET['page'] ? $_GET['page'] : 1 ;
  $perpage = 12;
  $start = ($page-1) * $perpage;
  $limit = 'LIMIT '.$start.','.$perpage;

  $sql   = 'SELECT SQL_CALC_FOUND_ROWS * FROM cj_hotel_room '.$limit;
  $g_db->query($sql);  
  while($row = $g_db->fetch_array()){
	  $roomList[] = $row;
  }
  $sql = " SELECT FOUND_ROWS() as num";
  $g_db->query($sql);  
  $row = $g_db->fetch_array();
  $countRoom = $row['num'];

  unset($_GET['page']); 
  $query = http_build_query($_GET);
  $pagestr = multi($countRoom, $perpage, $page, '?'.$query);


  include './mytpl/rooms.php'
?>
